home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Games / ISp Sample / Resources / ISp_Sample.r < prev   
Encoding:
Text File  |  2000-09-28  |  6.9 KB  |  350 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ISp_Sample.r
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Version:    xxx put version here xxx
  7.  
  8.     Copyright:    © 1999 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     File Ownership:
  11.  
  12.         DRI:                xxx put dri here xxx
  13.  
  14.         Other Contact:        xxx put other contact here xxx
  15.  
  16.         Technology:            xxx put technology here xxx
  17.  
  18.     Writers:
  19.  
  20.         (BWS)    Brent Schorsch
  21.  
  22.     Change History (most recent first):
  23.  
  24.        <SP2>      7/1/99    BWS        Fix typo
  25.        <SP1>      7/1/99    BWS        first checked in
  26. */
  27.  
  28. #include "MacTypes.r"
  29. #include "InputSprocket.r"
  30.  
  31. #Include "::Source:ISp_SampleResources.h"
  32.  
  33. //#Include "AppShell.r"
  34.  
  35. #define        rNoModifiers    rControlOff, rOptionOff, rShiftOff, \
  36.                             controlOff, optionOff, shiftOff, commandOff
  37.  
  38. resource 'STR#' (kSTRn_NeedNames, "Need Names")
  39. {
  40.     {
  41.         "Fire Weapon";
  42.         "Next Weapon";
  43.         "Previous Weapon";
  44.  
  45.         "Roll";
  46.         "Pitch";
  47.         "Yaw";
  48.         "Throttle";
  49.  
  50.         "Start/Pause Game";
  51.         "Quit";
  52.  
  53.         "Use Machine Gun";
  54.         "Use Cannon";
  55.         "Use Laser";
  56.         "Use Missile";
  57.         "Use Precision Bomb";
  58.         "Use Cluster Bomb";
  59.  
  60.         "Roll (Mouse)";
  61.         "Pitch (Mouse)";
  62.         "Yaw (Mouse)";
  63.  
  64.         "Yaw Left";
  65.         "Center Yaw";
  66.         "Yaw Right";
  67.         
  68.         "Min Throttle";
  69.         "Decrease Throttle";
  70.         "Increase Throttle";
  71.         "Max Throttle";
  72.     }
  73. };
  74.  
  75. resource 'STR#' (kSTRn_WeaponNames, "Weapon Names")
  76. {
  77.     {
  78.         "Machine Gun";
  79.         "Cannon";
  80.         "Laser";
  81.         "Missile";
  82.         "Precision Bomb";
  83.         "Cluster Bomb";
  84.     }
  85. };
  86.  
  87. /* the InputSprocket application resource tells utility programs how the */
  88. /* application uses InputSprocket */
  89.  
  90. resource 'isap' (kisap_ISpSample)
  91. {
  92.     callsISpInit,
  93.     usesInputSprocket
  94. };
  95.  
  96. /* the set list resource contains the list of all the saved sets for devices */
  97. /* that are provided in the application's resource fork */
  98.  
  99. resource 'setl' (ksetl_ISpSample, "ISp_Sample sets")
  100. {
  101.     currentVersion,
  102.     {
  103.         "Default (Keyboard)", 0, kISpDeviceClass_Keyboard, 
  104.             kISpKeyboardID_Apple, notApplSet, isDefaultSet, 
  105.             ktset_DefaultKeyboard,
  106.             
  107.         "All Left Hand", 0, kISpDeviceClass_Keyboard, 
  108.             kISpKeyboardID_Apple, isApplSet, notDefaultSet, 
  109.             ktset_LeftyKeyboard,
  110.  
  111.         "Default (mouse)", 0, kISpDeviceClass_Mouse, 'appl', 
  112.             notApplSet, isDefaultSet, ktset_DefaultMouse,
  113.             
  114.         "Yaw Mouse", 0, kISpDeviceClass_Mouse, 'appl', 
  115.             isApplSet, notDefaultSet, ktset_YawMouse,
  116.     };
  117. };
  118.  
  119. /* Default keyboard set */
  120. resource 'tset' (ktset_DefaultKeyboard, "Default (Keyboard)")
  121. {
  122.     supportedVersion,
  123.     {    
  124.         /* kNeed_FireWeapon */
  125.         kpd0Key,
  126.          rNoModifiers,
  127.         
  128.         /* kNeed_NextWeapon */
  129.         kpd9Key,
  130.          rNoModifiers,
  131.         
  132.         /* kNeed_PreviousWeapon */
  133.         kpd7Key,
  134.          rNoModifiers,
  135.         
  136.         
  137.         /* kNeed_Roll */
  138.         kpd4Key,                 /* min (left/down/back) */
  139.          rNoModifiers,
  140.          
  141.         kpd6Key,                 /* max (right/up/forward) */
  142.          rNoModifiers,
  143.  
  144.         /* kNeed_Pitch */
  145.         kpd5Key,                 /* min (left/down/back) */
  146.          rNoModifiers,
  147.          
  148.         kpd8Key,                 /* max (right/up/forward) */
  149.          rNoModifiers,
  150.         
  151.         /* kNeed_Yaw */
  152.         /* this need does not generate any items, because it has later button equivalents */
  153.  
  154.         /* kNeed_Throttle */
  155.         /* this need does not generate any items, because it has later button equivalents */
  156.     
  157.     
  158.         /* kNeed_StartPause */
  159.         tildeKey,
  160.          rNoModifiers,
  161.         
  162.         /* kNeed_Quit */
  163.         qKey,
  164.          rControlOff, rOptionOff, rShiftOff, controlOff, optionOff, shiftOff, commandOn,
  165.         
  166.         /* kNeed_Weapon_MachineGun */
  167.         n1Key,
  168.          rNoModifiers,
  169.         /* kNeed_Weapon_Cannon */
  170.         n2Key,
  171.          rNoModifiers,
  172.         /* kNeed_Weapon_Laser */
  173.         n3Key,
  174.          rNoModifiers,
  175.         /* kNeed_Weapon_Missle */
  176.         n4Key,
  177.          rNoModifiers,
  178.         /* kNeed_Weapon_PrecisionBomb */
  179.         n5Key,
  180.          rNoModifiers,
  181.         /* kNeed_Weapon_ClusterBomb */
  182.         n6Key,
  183.          rNoModifiers,
  184.     
  185.  
  186.         /* kNeed_Roll_AsDelta */
  187.         /* this need does not generate any items – the keyboard does not do deltas  */
  188.  
  189.         /* kNeed_Pitch_AsDelta */
  190.         /* this need does not generate any items – the keyboard does not do deltas  */
  191.  
  192.         /* kNeed_Yaw_AsDelta */
  193.         /* this need does not generate any items – the keyboard does not do deltas  */
  194.     
  195.  
  196.         /* kNeed_Yaw_Left */
  197.         aKey,
  198.          rNoModifiers,
  199.         /* kNeed_Yaw_Center */
  200.         sKey,
  201.          rNoModifiers,
  202.         /* kNeed_Yaw_Right */
  203.         dKey,
  204.          rNoModifiers,
  205.  
  206.         /* kNeed_Throttle_Min */
  207.         kpdEqualKey,
  208.          rNoModifiers,
  209.         /* kNeed_Throttle_Decrease */
  210.         kpdMinusKey,
  211.          rNoModifiers,
  212.         /* kNeed_Throttle_Increase */
  213.         kpdPlusKey,
  214.          rNoModifiers,
  215.         /* kNeed_Throttle_Max */
  216.         kpdSlashKey,
  217.          rNoModifiers,
  218.  
  219.     };
  220. };
  221.  
  222. resource 'tset' (ktset_LeftyKeyboard, "All Left Hand")
  223. {
  224.     supportedVersion,
  225.     {    
  226.         /* kNeed_FireWeapon */
  227.         spaceKey,
  228.          rNoModifiers,
  229.         
  230.         /* kNeed_NextWeapon */
  231.         eKey,
  232.          rNoModifiers,
  233.         
  234.         /* kNeed_PreviousWeapon */
  235.         qKey,
  236.          rNoModifiers,
  237.         
  238.         
  239.         /* kNeed_Roll */
  240.         noKey,                     /* min (left/down/back) */
  241.          rNoModifiers,
  242.          
  243.         noKey,                     /* max (right/up/forward) */
  244.          rNoModifiers,
  245.  
  246.         /* kNeed_Pitch */
  247.         noKey,                     /* min (left/down/back) */
  248.          rNoModifiers,
  249.          
  250.         noKey,                     /* max (right/up/forward) */
  251.          rNoModifiers,
  252.         
  253.         /* kNeed_Yaw */
  254.         /* this need does not generate any items, because it has later button equivalents */
  255.  
  256.         /* kNeed_Throttle */
  257.         /* this need does not generate any items, because it has later button equivalents */
  258.     
  259.     
  260.         /* kNeed_StartPause */
  261.         tildeKey,
  262.          rNoModifiers,
  263.         
  264.         /* kNeed_Quit */
  265.         qKey,
  266.          rControlOff, rOptionOff, rShiftOff, controlOff, optionOff, shiftOff, commandOn,
  267.         
  268.         /* kNeed_Weapon_MachineGun */
  269.         n1Key,
  270.          rNoModifiers,
  271.         /* kNeed_Weapon_Cannon */
  272.         n2Key,
  273.          rNoModifiers,
  274.         /* kNeed_Weapon_Laser */
  275.         n3Key,
  276.          rNoModifiers,
  277.         /* kNeed_Weapon_Missle */
  278.         n4Key,
  279.          rNoModifiers,
  280.         /* kNeed_Weapon_PrecisionBomb */
  281.         n5Key,
  282.          rNoModifiers,
  283.         /* kNeed_Weapon_ClusterBomb */
  284.         n6Key,
  285.          rNoModifiers,
  286.     
  287.  
  288.         /* kNeed_Roll_AsDelta */
  289.         /* this need does not generate any items – the keyboard does not do deltas  */
  290.  
  291.         /* kNeed_Pitch_AsDelta */
  292.         /* this need does not generate any items – the keyboard does not do deltas  */
  293.  
  294.         /* kNeed_Yaw_AsDelta */
  295.         /* this need does not generate any items – the keyboard does not do deltas  */
  296.     
  297.  
  298.         /* kNeed_Yaw_Left */
  299.         aKey,
  300.          rNoModifiers,
  301.         /* kNeed_Yaw_Center */
  302.         sKey,
  303.          rNoModifiers,
  304.         /* kNeed_Yaw_Right */
  305.         dKey,
  306.          rNoModifiers,
  307.  
  308.         /* kNeed_Throttle_Min */
  309.         zKey,
  310.          rNoModifiers,
  311.         /* kNeed_Throttle_Decrease */
  312.         xKey,
  313.          rNoModifiers,
  314.         /* kNeed_Throttle_Increase */
  315.         cKey,
  316.          rNoModifiers,
  317.         /* kNeed_Throttle_Max */
  318.         vKey,
  319.          rNoModifiers,
  320.  
  321.     };
  322. };
  323.  
  324. data 'tset' (ktset_DefaultMouse, "Default (mouse)")
  325. {
  326.     $"000000043F8000003F8000003F800000"
  327.     $"FFFF0001FFFF000100000000FFFF0001"
  328.     $"FFFF0001FFFF0001FFFF0001FFFF0001"
  329.     $"FFFF0001FFFF0001000000100000000F"
  330.     $"000000100000000FFFFF0001FFFF0001"
  331.     $"FFFF00010000000000000000FFFF0001"
  332.     $"FFFF0001FFFF00010000001000000011"
  333.     $"0000001000000011FFFF0001FFFF0001"
  334.     $"FFFF0001000000000000000000000000"
  335.     $"0000000000000000"
  336. };
  337.  
  338. data 'tset' (ktset_YawMouse, "Yaw Mouse")
  339. {
  340.     $"000000043F8000003F8000003F800000"
  341.     $"FFFF0001FFFF000100000000FFFF0001"
  342.     $"FFFF0001FFFF0001FFFF0001FFFF0001"
  343.     $"FFFF0001FFFF00010000001000000011"
  344.     $"0000001000000011FFFF0001FFFF0001"
  345.     $"FFFF0001000000000000000000000000"
  346.     $"00000000000000000000000027E03C00"
  347.     $"02E53AA0000000000000010002E54F40"
  348.     $"04D2286080600000FFFF017C00000000"
  349.     $"0000000000000048"
  350. };